<?php

namespace IDock\Insurance\JTIC\Request;

use IDock\Insurance\JTIC\Response\VehicleModelResponse;
use IDock\Visitor\VehicleModelVisitor;

class VehicleModelRequest extends AllJTICRequest
{
    protected $code = 'V202';

    protected $response = VehicleModelResponse::class;

    protected $urlTip = '车型查询';

    /*** @var  VehicleModelVisitor $visitor */
    protected $visitor;

    public function generate(): array
    {
        return [
            'BasePart'=> [
                'QueryModel' => '1',
                'PageSize' => '50',
                'PageNo' => '1',
//                'VehicleName' => $this->visitor->vehicleModel,
                'VehicleName' => preg_replace('/[\x{4e00}-\x{9fa5}]/u', '', $this->visitor->vehicleModel),
                //'VehicleClass' => '轿车类,货车类,越野车类,微型车类,轻型货车类,大型客车类,摩托车类',
                'VehicleClass' => '',
                'DeptTeamCode' => $this->visitor->argc['DeptTeamCode'] ?? '',
                'FirstRegisterDate' => $this->visitor->firstRegisterDate ? date('Ymd',strtotime($this->visitor->firstRegisterDate)) : '',
                'VIN' => $this->visitor->vin,
            ],
        ];
    }
}
